﻿<!DOCTYPE HTML>
<!DOCTYPE html PUBLIC "" ""><HTML><HEAD><META content="IE=11.0000" 
http-equiv="X-UA-Compatible">
   
<META charset="UTF-8">   
<META name="Author" content="hello">   
<META name="Keywords" content="">   
<META name="Description" content="">   <TITLE>随机色卡   </TITLE>   
<STYLE type="text/css">
	*{margin:0;padding:0;}
	ul,ol{list-style:none;}
	a{text-decoration:none;}
		
		span{
			display:inline-block;
			width:80px;
			height:40px;
			float:left;
			color:white;
			text-align:center;
			line-height:40px;
		}

  </STYLE>
   
<SCRIPT>

	//总结步骤：1、span样式
	//2、随机16进制色值
	//3、定时器的创建和清楚
	var count = 0,
		timer = setInterval(function(){
		var o = document.createElement('span'),
			color = '#';
			for(var i=0;i<6;i++){
				color += Math.floor(Math.random()*16).toString(16);
			}
		o.style.background = color;
		console.log(color);
		o.innerHTML = color;
		document.body.appendChild(o);	
		count ++;
		if(count == 500)clearInterval(timer);
		
	},13);
  </SCRIPT>
  
<META name="GENERATOR" content="MSHTML 11.00.10570.1001"></HEAD>  
<BODY></BODY></HTML>
